cmake_minimum_required(VERSION 3.16)

set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR})

project ("ciallo_imgui")

if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
option(CIALLO_BUILD_SANDBOX "Build the sandbox" ON)
option(CIALLO_ENABLE_PYTHON_EXT "Enable python extension" ON)

add_subdirectory(vendor)

add_subdirectory(src)

if (${CIALLO_ENABLE_PYTHON_EXT})
  if (CMAKE_VERSION VERSION_LESS 3.18)
  set(DEV_MODULE Development)
  else()
  set(DEV_MODULE Development.Module)
  endif()

  find_package(Python 3.8 COMPONENTS Interpreter ${DEV_MODULE} REQUIRED)
  add_subdirectory(vendor/nanobind)
endif()

if (${CIALLO_BUILD_SANDBOX})
  add_subdirectory(sandbox)
endif (${CIALLO_BUILD_SANDBOX})